



import requests
#定义接口的url和拼接在URL中的请求参数
def get_by_params():
    url = "https://httpbin.ceshiren.com/get"
    param ={
        "get_key":"get_value"
    }
    r = requests.get(url,params=param)
    print(r.json())
def get_by_url():
    #定义接口中的请求参数和拼接在URL中的请求参数
    url = "https://httpbin.ceshiren.com/get?get_key=get_value"
    r=requests.get(url)
    print(r.json())
get_by_params()
get_by_url()

